-include ../../Makefile.begin

# Target.
$(this_PREFIX)CHK_PROGRAMS := valid

# Source files.
$(this_PREFIX)valid_SOURCES := \
        Utils.hh Define.hh \
        Utils.cc           Misc.cc Bundles.cc Services.cc LifeCycle.cc Valid.cc

# Extra dependencies.
working_directories := $(addprefix $(BUILD_DIR)bin/,bundles cache save tmp)
environment_files   := $(addprefix $(BUILD_DIR)bin/,osgi.ini Report.xsl)

$(this_PREFIX)valid_DEPENDENCIES = $(working_directories) \
                                   $(environment_files) \
                                   $(BUNDLES)

$(this_PREFIX)valid_EXTRA_CLEAN := $(working_directories) \
                                   $(environment_files) \
                                   $(addprefix $(BUILD_DIR)bin/,stdout.txt stderr.txt Report.xml)

# Extra rules.
$(working_directories):
	@mkdir -p $@

$(environment_files): $(BUILD_DIR)bin/% : $(call this_DIR)%
	@cp -u $< $@

# Libraries
$(this_PREFIX)valid_ADD_LIBRARIES := OSGi++
$(this_PREFIX)valid_ADD_LDFLAGS   := -lcppunit

$(this_PREFIX)valid_EXTRA_DIST := Report.xsl osgi.ini
